<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>删人提醒</title>

  <link rel="stylesheet" href="/layui/css/layui.css">
  <link rel="stylesheet" href="/khlist/css/common.css">

  <link rel="stylesheet" href="/fission/css/iconfont.css">
  <link rel="stylesheet" href="/hyqcss/public.css">
</head>
<body style="background-color: #fff;">
     <ul class="public-header-nav">
        <li><a  href="index.html">客户属性筛选</a></li>
        <li><a class="public-header-nav-active" href="#">删人提醒选择</a></li>
     </ul>
    <form class="layui-form" id="form1">
        <div class="public_table_container">
               <div class="layui-form-item">
                    <label class="layui-form-label">
                         <span style="color: red;">*</span>
                         提醒类型:
                    </label>
                    <div class="layui-input-block" id="typeRadio">
                         <input type="radio" lay-filter="type" name="type" value="1" title="使用权限管理" {if $users->type != 2} checked {/if}>
                         <input type="radio" lay-filter="type" name="type" value="2" title="使用选择客户" {if $users->type == 2} checked {/if}>
                    </div>
               </div>
               <div class="public_form_List" {if $users->type != 2} style="display:none;" {/if}>
                    <div class="public_formTitle_container">
                         <lable class="layui-form-label"><span style="color: red;">*</span>提醒成员：</lable>
                    </div>
                    <div class="public_formOther_container">
                         <div class="layui-input-block">
                              <div class="layui-input-inline" style="display: flex;">
                                <button data-type="one" type="button" class="layui-btn layui-btn-primary addPeople">+ 添加成员</button>
                                <div class="layui-form-mid layui-word-aux">可选择多位员工进行删人提醒</div>
                            </div>
                         </div>
                         <div class="flex align-start" style="padding: 6px 5px 0px 105px;" id="checkUserCon">
                              {if count($users->users)}
                                   {loop $users->users as $user}
                                        <div class="service-card">
                                             <i class="iconfont icon-person"></i>{$h->get_user_by_id($wid,$user)['name']}
                                        </div>
                                   {/loop}
                              {/if}
                         </div>
                    </div>
                    <input type="hidden" name="users" id="checkUser" />
               </div>
          </div>
          <div class="layui-form-item">
               <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
               </div>
          </div>
    </form>
</body>
<script type="text/javascript" src="/layui/layui.all.js"></script>
<script type="text/javascript" src="/js/ajax.js"></script>
<script type="text/javascript">
     $('.addPeople').on('click',function(){
          var type = $(this).data("type");
          layer.open({
            type: 2,
            title: '请选择使用人员',
            shadeClose: true,
            shade: 0.2,
            area: ['700px', '530px'],
            content: 'select_user-'+type+'.html'
          }); 
     })


     layui.use('form', function () {
          var form = layui.form;
          //监听提交
          form.on('submit(formDemo)', function (data) {
               var formData = $('#form1').serialize(); 
               myAjaxPost(false, true, '', formData, function (resp) {
                    tusi(resp.msg);
               });
          });
          form.on('radio(type)', function (data) {
               if ($('#typeRadio input[name="type"]:checked').val() == 1) {
                    $(".public_form_List").hide();
               } else if ($('#typeRadio input[name="type"]:checked').val() == 2) {
                    $(".public_form_List").show();
               }
               form.render();
          });
     });
</script>
</html>